const httpRequest = require("@/common/httpRequest.js")
import App from './App'
const copy = (value) => { //复制
	uni.setClipboardData({
		data: value, //要被复制的内容
		success: () => {
			//复制成功的回调函数
			httpRequest.toast("复制成功")
		}
	});
}
const lbtpriview = (index, arr) => {//预览图片
	var i = arr; //获取当前页面的轮播图数据
	//uniapp预览轮播图
	uni.previewImage({
		current: index, //预览图片的下标
		urls: i //预览图片的地址，必须要数组形式，如果不是数组形式就转换成数组形式就可以
	})
}
const callphone = (p) => {//拨打电话
	uni.makePhoneCall({
		phoneNumber: p.toString()
	}).catch((e) => {
		// console.log(e)  //用catch(e)来捕获错误{makePhoneCall:fail cancel}
	})
}
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
Vue.prototype.copy = copy
Vue.prototype.lbtpriview = lbtpriview
Vue.prototype.callphone = callphone
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif
// main.js
import uView from "uview-ui";
Vue.use(uView);